Skip to content

refactor: major cleanup - new display module, bug fixes, shiny detection#9

Open
SamiraUrzua wants to merge 18 commits intoyling:mainfrom
SamiraUrzua:main
Open

refactor: major cleanup - new display module, bug fixes, shiny detection#9
SamiraUrzua wants to merge 18 commits intoyling:mainfrom
SamiraUrzua:main

Conversation

@SamiraUrzua
Copy link
Copy Markdown

Refactor and improve codebase: modularize rendering, fix critical bugs, add shiny detection

Refactoring:
Extracted rendering logic to display.lua module for maintainability
Reorganized variable scopes and localized variables to prevent global variable conflicts

Bug Fixes:
Added Pokémon data validation to catch when trash data is loaded
Fixed Gen 4 enemy Pokémon failing to load unless script was started during battle
Fixed crash when loading Pokémon with nonexistent species ID (trash data)
Fixed global variable conflict causing memory read functions to access incorrect parts of memory

New Feature:
Added shiny detection and display for Gen 3–5
Keep rendering UI when Pokémon data unavailable
Reload data when current hp changes are detected

Fix: Gen 4 enemy Pokémon only appeared if the script started during a battle

Fix: Pokémon data loaded before it was ready, causing incorrect display

Fix: crashes when loading a Pokémon with a nonexistent species ID

Feature: shiny detection and display for Gen 3–5
…issues

- Move state management and key press input handling to main script

- Group and localize main script variables to prevent global scope issues

- Migrate all rendering code to display.lua module

- Improve variable names for better code clarity

- Fix Gen 1-2 screen layout to eliminate overlapping text

- Restore accidentally removed contest stats labels

- Fix global variable conflict causing memory read functions to access incorrect locations
@SamiraUrzua SamiraUrzua reopened this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant